<template>
  <view class="withdraw">
    <view class="list">
      <view class="title flex flex-align flex-bt">
        <view class="name">提现金额</view>
        <view class="price">可提现金额：￥{{teamInfo.commission_cash}}</view>
      </view>
      <view class="input flex flex-align">
        <input type="number" v-model="frames.amount" placeholder="请输入提现金额" />
      </view>
    </view>
    <view class="miaoshu">单次最小提现额度不得低于10元，每月最多提现2次，这里是提现规则说明这里是提现规则说明</view>
    <view class="list mt30">
      <view class="title flex flex-align flex-bt">
        <view class="name">提现到</view>
      </view>
      <view class="input flex flex-align flex-bt">
        <view class="left flex flex-align">
          <image src="@/static/shop/shop04.png" mode="scaleToFill" />
          <view>微信账户</view>
        </view>
        <radio color="#FE7431" :checked="true" style="transform: scale(.8);" />
      </view>
    </view>
    <view class="submite" @click="submite">确认提现</view>
  </view>
</template>

<script setup lang="ts">
import { applyWithdraw, groupInfo } from '@/api/user'
import { onShow } from '@dcloudio/uni-app'
import { reactive, ref } from 'vue'
const teamInfo = ref<Recordable>({})
const frames = reactive({
  amount:'',
  type: 1,
})
onShow(() => {
  getTeamCenterInfo()
})
function submite() {
  if(frames.amount == '') {
    uni.showToast({
      title: '请输入提现金额',
      icon: 'none'
    })
    return
  }
  applyWithdraw(frames).then((res:any) => {
    uni.showToast({
      title: '提现成功',
      icon: 'none'
    })
  })
}
function getTeamCenterInfo() {
  groupInfo().then((res: any) => {
    teamInfo.value = res.asset
  })
}
</script>

<style scoped lang="scss">
.withdraw{padding: 30rpx;
  .list{
    .price{font-size: 24rpx;color: #969799;}
    .input{background: #fff;height: 90rpx;border-radius: 10rpx;margin-top: 20rpx;
      input{font-size: 26rpx;padding: 0 20rpx;}
      .left{padding-left: 20rpx;
        image{width:60rpx;height: 60rpx;margin-right: 10rpx;}
      }
    }
  }
  .miaoshu{font-size: 24rpx;color: #969799;margin: 20rpx 0;}
  .submite{background: #FE7431;height: 80rpx;border-radius: 10rpx;display: flex;align-items: center;justify-content: center;font-size: 28rpx;color: #fff;
    width: 400rpx;margin: 70rpx auto 20rpx;border-radius: 80rpx;
  }
}
.mt30{margin-top: 40rpx;}
</style>